import math

a = int(input())
lee = math.log10(2) * a + 1
b = pow(2, a,
        100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
b = b - 1
c = '%0500d' % b
a1 = int(50)
a2 = int(10)
print(int(lee))
k = int(0)
for j in range(a2):
    for i in range(a1):
        print(c[k], end='')
        k = k + 1
    print(" ")
